﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DLL;
using Module;

namespace BLL
{
    public class BFamousRegion
    {
        #region 字段

        private DFamousRegion APP = new DFamousRegion();//数据操作对象
        private static BFamousRegion instance;

        #endregion

        #region 公共接口
        /// <summary>
        /// 取得
        /// </summary>
        /// <returns>BUserPassport对象</returns>
        public static BFamousRegion getInstance()
        {
            if (instance == null)
            {
                instance = new BFamousRegion();
            }
            return instance;
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="userProfileInfo"></param>
        /// <returns></returns>
        public bool Insert(FamousRegionInfo famousRegionInfo)
        {
            if (famousRegionInfo == null || famousRegionInfo.FamousRegionId == 0)
                return false;
            return APP.Insert(famousRegionInfo);
        }
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="paperInfo"></param>
        /// <returns></returns>
        public bool Update(FamousRegionInfo famousRegionInfo)
        {
             if (famousRegionInfo == null || famousRegionInfo.FamousRegionId == 0)
                return false;
             return APP.Update(famousRegionInfo);
        }

        /// <summary>
        /// 根据Id获取名人专区
        /// </summary>
        /// <param name="famousRegionId"></param>
        /// <returns></returns>
        public FamousRegionInfo GetFamousRegionInfo(long famousRegionId)
        {
            if (famousRegionId == 0 || famousRegionId.ToString().Length != 18)
            {
                return null;
            }
            return APP.GetFamousRegionInfo(famousRegionId);

        }
         /// <summary>
        /// 获取所有名人专区
        /// </summary>
        /// <returns></returns>
        public List<FamousRegionInfo> GetAllFamousRegions()
        {
            return APP.GetAllFamousRegions();
        }

        public FamousRegionInfo GetFamousRegionInfoByTitle(string titleName)
        {
            if (string.IsNullOrWhiteSpace(titleName))
            {
                return null;
            }
            return APP.GetFamousRegionInfoByTitle(titleName);
        }
        #endregion

    }
}
